pp108 : Using Message Map

Using Message Map

This topic describes how to use the Message Map to associate data.

Process Platform XForms provides an easy-to-use interface for mapping data between two data sources without having to resort to manual scripting. Using the Message Map, you can map model data to various controls in an XForm.

In case of composite controls such as Google Map and Chart controls, the data format differs from the standard data format of Process Platform models. Message Map enables you to define data associations between such disparate data sources. The Message Map uses the schema of a composite control to map it to a Process Platform model.

Process Platform supports two-way mapping of data, that is,

  • changes in model data are reflected in the mapped XForms control, and
  • changes made to data in the XForm control are reflected in the mapped model.

A Mapping Object represents the association defined between two data sources. For details, see Mapping Object.

You can launch the Message Map through the Model Properties dialog box.

  1. Select Advanced in the XForms Designer toolbar. The toolbar expands to display icons that launch advanced functionality in the XForm.
  2. Click (Manage Model) in the XForm Designer toolbar. The Manage Model dialog box displays all the models associated with the XForm.
  3. Click for the model that needs to be mapped. The Message Map dialog box appears. The Message Map dialog box comprises Source and Target panes that are separated by a middle area where data associations are defined. The middle area contains rowsof two fields each that display mapped elements. All the available data sources (controls withschema) are listed in the Source and Target panes. A Source element provides data for mapping and a Target accepts data from the source and processes it. Based on the requirements of the application you are creating, you can define a data source as a source or a target in the Message Map.
  4. Expand the nodes under the Source pane and drag the element to be mapped to a field in a row in the middle pane. Similarly, drag the corresponding element to be mapped from the Targetpane to the second field in the row.

    Note:
    While creating a message map using a chart, map the X-Axis label to a string and Y-Axis label to a numeric value.

This maps data from source to the target. The mapped data is represented as follows in the XML Editor.

<xml id="EmployeesTable_xforms-onrowselect_assignments">
    <Assignments>
        <Assignment>
            <Source>city/value</Source>
            <Target>googlemap1/Map/Location/City</Target>
            <Operation/>
        </Assignment>
    </Assignments>
</xml>